package com.deyuanyun.pic.ae.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * “页面综合跳转” 管理控制类
 *
 * 方法详情：<br/>
 *
 * @author huanglw
 * @date  2016-11-14
 *
 * History: [修改人][时间][修改描述]
 */
@Controller
@RequestMapping("/ae/aeIndex")
public class AEIndexController {

    /**
     * 跳转到 新建或者编辑 页面
     *
     * @param id 对象的id值
     * @param type 对象类型
     * @return
     */
    @RequestMapping("/{type}/toEdit.html")
    public ModelAndView toEdit(String id, @PathVariable("type") String type) {
        ModelAndView mav = new ModelAndView();
        mav.addObject("id", id);
        mav.addObject("type", type);
        mav.setViewName("/ae/addEdit");
        return mav;
    }

    /**
     * 跳转到 审核 页面
     *
     * @param id 对象的id值
     * @param type 对象类型
     * @return
     */
    @RequestMapping("/{type}/toAudit.html")
    public ModelAndView toAudit(String id, @PathVariable("type") String type) {
        ModelAndView mav = new ModelAndView();
        mav.addObject("id", id);
        mav.addObject("type", type);
        mav.setViewName("/ae/examineAll");
        return mav;
    }
}
